<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 修改引用文件路径方式，避免重定向后样式设置文件丢失 --> 
<%String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
request.setAttribute("path", basePath);  
%>

<link rel="stylesheet" type="text/css" href="${path}pages/css/login.css">
<script type="text/javascript" src="${path}pages/common/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="${path}pages/js/register.js"></script>
<title>注册</title>
<script type="text/javascript">
    	//修改图片(修改之前需要先拿到这张图片)
    	function changeImg(img){
    		//console.debug(document.getElementById("myImg"));
    		//如果请求相同，会找缓存中的数据，就不会重新发送 
    		//每次请求产生不同的产生提交
    		img.src = "/xiaomi/user/randomCode?code="+Math.random();
    	}
    </script>
</head>
<body>
<form  method="post" action="/xiaomi/user/register">
		<div class="regist">
			<div class="regist_center">
				<div class="regist_top">
					<div class="left fl">会员注册</div>
					<div class="right fr"><a href="./index.html" target="_self">小米商城</a></div>
					<div class="clear"></div>
					<div class="xian center"></div>
				</div>
				<div class="regist_main center">
					<div class="username">用&nbsp;&nbsp;户&nbsp;&nbsp;名:&nbsp;&nbsp;<input class="shurukuang" type="text" maxlength="16" name="username" id="username" placeholder="请输入你的用户名"/><span id="prompt">用户名由3-16位字母和数字组成</span></div>
					<div class="username">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:&nbsp;&nbsp;<input class="shurukuang" type="password" name="password" maxlength="18" id="password" placeholder="请输入你的密码"/><span id="cue">密码由6-18位字母和数字组成</span></div>
					<div class="username">确认密码:&nbsp;&nbsp;<input class="shurukuang" type="password" maxlength="18" id="repassword" placeholder="请确认你的密码"/><span id="hint">前后密码要一致</span></div>
					<div class="username">手&nbsp;&nbsp;机&nbsp;&nbsp;号:&nbsp;&nbsp;<input class="shurukuang" type="text" maxlength="11" name="telephone" id="telephone" placeholder="请填写正确的手机号"/><span id="point">填写下手机号吧，方便我们联系您！</span></div>
					<div class="username">
						<div class="left fl">验&nbsp;&nbsp;证&nbsp;&nbsp;码:&nbsp;&nbsp;<input class="yanzhengma" type="text" maxlength="5" id="code" name="user" placeholder="请输入验证码"/></div>
						<div class="right fl"><img src="/xiaomi/user/randomCode"style="cursor:pointer;"
					 title="点我替换.." onclick="changeImg(this)"><span id="proving">请输入验证码</span></div>
						<div class="clear"></div>
					</div>
				</div>
				
				<div class="regist_submit">
					 <input class="submit" type="submit" name="submit" value="立即注册" >
				</div>
			</div>
		</div>
		</form>
		<div class="regist_submit">

</body>
</html>